<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">
    $("#itemTable").treeTable({expandLevel: 2});
</script>
<div class="panel-body">

                <div class="pull-left">
                    <input id="btnSubmit"
                           onclick="addSubProject('rigthCenterDiv','${applyId}','${ctx}/treatProjectItem/treatProjectItem/formTreat?type=2&applyId=${applyId}')"
                           class="btn btn-primary" type="submit" value="添加"/>
                    <input onclick="addSubOrder('1','rigthCenterDiv','${ctx}/treatProjectItem/treatProjectItem/formTreat?type=2&applyId=${applyId}')"
                           class="btn btn-add" type="submit" value="子处方"/>
                </div>
            </div>
            <table id="itemTable" class="table table-bordered mg-t datatable">
                <thead>
                <tr>
                    <%--<th>治疗类型</th>--%>
                    <th>类别</th>
                    <th style="display:none"></th>
                    <th>处方内容</th>
                    <th>频次</th>
                    <th>途径</th>
                    <th>单次剂量</th>
                    <th>单位</th>
                    <th>包装规格</th>
                    <%--<th>厂商</th>--%>
                    <%--<th>执行科室</th>--%>
                    <%--<th>开单科室</th>--%>
                    <th>数量</th>
                    <th>单价</th>
                    <th>总价</th>
                    <th>医生说明</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${treeList}" var="treatProjectItem">
                    <c:choose>
                        <c:when test="${!empty treatProjectItem.parent.id}">
                                <tr id='${treatProjectItem.id}' pId='${treatProjectItem.parent.id}'>
                        </c:when>
                            <c:otherwise>
                                 <tr id='${treatProjectItem.id}'>
                            </c:otherwise>
                        </c:choose>
                    <td> ${fns:getDictLabels(treatProjectItem.orderClass,'BILL_ITEM_CLASS_DICT','')}</td>
                    <td style="display:none"><input type="hidden" value="${treatProjectItem.id}"/></td>
                        <%--<td> ${treatProjectItem.treatProjectId}</td>--%>

                    <td> ${treatProjectItem.orderText}</td>
                    <td><input type="hidden"
                               value="${treatProjectItem.performFreq}"> ${fns:findFreqDesc(treatProjectItem.performFreq, '')}
                    </td>
                    <td><input type="hidden"
                               value="${treatProjectItem.administration}"> ${fns:getSysDictLabel(treatProjectItem.administration, 'ADMINISTRATION_DICT', '')}
                    </td>
                    <td> ${treatProjectItem.singleDose}</td>
                    <td> ${treatProjectItem.singleDoseUnit}</td>
                    <td> ${treatProjectItem.packageSpec}</td>
                        <%--<td> ${treatProjectItem.firmId}</td>--%>
                        <%--<td> ${fns:getDeptName(treatProjectItem.performedBy,'')}</td>--%>
                        <%--<td> ${fns:getDeptName(treatProjectItem.newDept,'')}</td>--%>
                        <td> ${treatProjectItem.amount}</td>
                    <td> ${treatProjectItem.price}</td>
                        <td> ${treatProjectItem.sumPrice}</td>
                    <td> ${treatProjectItem.doctInstruction}</td>
                    <td>
                        <a href="#"
                           onclick="addSubProject('rigthCenterDiv','${applyId}','${ctx}/treatProjectItem/treatProjectItem/formTreat?type=2&applyId=${applyId}&id=${treatProjectItem.id}');"
                           class="btn btn-success btn-xs">修改</a>
                        <a href="#" class="applyBt btn btn-danger btn-xs"
                           onclick="confirmExtend('确认要删除该吗？',function(){delLoad('treatProjectItem','${ctx}/treatProjectItem/treatProjectItem/delete?id=${treatProjectItem.id}','${ctx}/treatProjectItem/treatProjectItem/indexTreat?type=2&id=${applyId}')})">删除</a>
                    </td>
                </tr>
                </c:forEach>
            </table>
